<div class="container">
	<div class="panel panel-default">
		<div class="panel-body">
			<div>
				<span class="glyphicon glyphicon-user">&nbsp;门店信息管理&nbsp;</span> <span
					class="glyphicon glyphicon-chevron-right">&nbsp;添加门店信息&nbsp;</span>
				<a href="javascript:window.history.go(-1);">返回</a>
			</div>
		</div>
	</div>
	<form role="form" class="form-horizontal" name="addStoreForm"
		ng-init="addStoreFormInit()">
		<div class="col-sm-6">
			<div class="form-group"
				ng-class="{'has-error':addStoreForm.storeNo.$invalid && addStoreForm.storeNo.$dirty}">
				<label for="storeNo" class="control-label col-sm-4">门店编号：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="storeNo" name="storeNo"
						placeholder="请输入四位纯数字" name="storeNo" ng-model="storeNo" required
						ng-pattern="/^\d{4}$/" />
					<div ng-show="addStoreForm.storeNo.$error.pattern">
						<span class="errorText">请输入四位纯数字</span>
					</div>
				</div>
			</div>
			<div class="form-group"
				ng-class="{'has-error':addStoreForm.storeName.$invalid && addStoreForm.storeName.$dirty}">
				<label for="storeName" class="control-label col-sm-4">门店名称：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="storeName"
						name="storeName" placeholder="名称最短为两个汉字" name="storeName"
						ng-model="storeName" ng-required="true" ng-minlength="2"
						ng-maxlength="30" />
					<div ng-show="addStoreForm.storeName.$error.minlength">
						<span class="errorText">最少输入两个字符！</span>
					</div>
					<div ng-show="addStoreForm.storeName.$error.maxlength">
						<span class="errorText">最多输入30个字符！</span>
					</div>
					<div
						ng-show="addStoreForm.storeName.$error.required && addStoreForm.storeName.$dirty">
						<span class="errorText">请输入字符！</span>
					</div>
				</div>
			</div>
			<div class="form-group"
				ng-class="{'has-error':addStoreForm.storeAddress.$invalid && addStoreForm.storeAddress.$dirty}">
				<label for="storeAddress" class="control-label col-sm-4">门店地址：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="storeAddress"
						placeholder="请输入门店地址" name="storeAddress" ng-model="storeAddress"
						ng-required="true" ng-minlength="2" ng-maxlength="100" />
					<div
						ng-show="addStoreForm.storeAddress.$error.required && addStoreForm.storeAddress.$dirty">
						<span class="errorText">请输入字符！</span>
					</div>
					<div ng-show="addStoreForm.storeAddress.$error.minlength">
						<span class="errorText">最少输入两个字符！</span>
					</div>
					<div ng-show="addStoreForm.storeAddress.$error.maxlength">
						<span class="errorText">最多输入100个字符！</span>
					</div>
				</div>
			</div>
			<div class="form-group" ng-class="{'has-error':addStoreForm.storeIntroduce.$invalid && addStoreForm.storeIntroduce.$dirty}">
				<label for="storeIntroduce" class="control-label col-sm-4">门店介绍：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="storeIntroduce"
						placeholder="请输入门店介绍" name="storeIntroduce"
						ng-model="storeIntroduce" ng-required="true" ng-minlength="2"
						ng-maxlength="100" />
					<div
						ng-show="addStoreForm.storeIntroduce.$error.required && addStoreForm.storeIntroduce.$dirty">
						<span class="errorText">请输入字符！</span>
					</div>
					<div ng-show="addStoreForm.storeIntroduce.$error.minlength">
						<span class="errorText">最少输入两个字符！</span>
					</div>
					<div ng-show="addStoreForm.storeIntroduce.$error.maxlength">
						<span class="errorText">最多输入100个字符！</span>
					</div>
				</div>
			</div>
			<div class="form-group" ng-class="{'has-error':startTime>closeTime}">
				<label for="startTime" class="col-sm-4 control-label">开始营业时间：</label>
				<div class="input-group date form_time col-sm-6 col-sm-offset-5"
					data-date="" data-date-format="hh:ii" data-link-field="startTime"
					data-link-format="hh:ii">
					<input class="form-control" size="16" type="text" value=""
						ng-model="startTime" required disabled>
					<!--                     <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span> -->
					<span class="input-group-addon time-btn"><span
						class="glyphicon glyphicon-time"></span></span>
				</div>
			</div>
			<div class="form-group" ng-class="{'has-error':startTime>closeTime}">
				<label for="closeTime" class="col-sm-4 control-label">结束营业时间：</label>
				<div class="input-group date form_time col-sm-6 col-sm-offset-5"
					data-date="" data-date-format="hh:ii" data-link-field="closeTime"
					data-link-format="hh:ii">
					<input class="form-control" size="16" type="text" value=""
						ng-model="closeTime" required disabled> <span
						class="input-group-addon time-btn"><span
						class="glyphicon glyphicon-time"></span></span>
				</div>
				<span class="col-sm-offset-4 errorText"
					ng-show="startTime > closeTime">结束时间必须晚于开始时间！</span>
			</div>
		</div>
		<div class="col-sm-6">
			<div class="form-group"
				ng-class="{'has-error':addStoreForm.maxLatitude.$invalid && addStoreForm.maxLatitude.$dirty}">
				<label for="maxLatitude" class="control-label col-sm-4">最大纬度：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="maxLatitude"
						placeholder="请输入最大纬度" name="maxLatitude" ng-model="maxLatitude"
						ng-pattern="/^[\-\+]?([0-8]?\d{1}\.\d{1,5}|90\.0{1,5})$/" required />
					<div
						ng-show="addStoreForm.maxLatitude.$invalid && addStoreForm.maxLatitude.$dirty">
						<span class="errorText">请输入正确的纬度(-90.0~+90.0，必须输入1到5位小数)</span>
					</div>
				</div>
			</div>
			<div class="form-group"
				ng-class="{'has-error':addStoreForm.minLatitude.$invalid && addStoreForm.minLatitude.$dirty}">
				<label for="minLatitude" class="control-label col-sm-4">最小纬度：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="minLatitude"
						placeholder="请输入最小纬度" name="minLatitude" ng-model="minLatitude"
						ng-pattern="/^[\-\+]?([0-8]?\d{1}\.\d{1,5}|90\.0{1,5})$/" required />
					<div
						ng-show="addStoreForm.minLatitude.$invalid && addStoreForm.minLatitude.$dirty">
						<span class="errorText">请输入正确的纬度(-90.0~+90.0，必须输入1到5位小数)</span>
					</div>
				</div>
			</div>
			<div class="form-group"
				ng-class="{'has-error':addStoreForm.maxLongitude.$invalid && addStoreForm.maxLongitude.$dirty}">
				<label for="maxLongitude" class="control-label col-sm-4">最大经度：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="maxLongitude"
						placeholder="请输入最大经度" name="maxLongitude" ng-model="maxLongitude"
						ng-pattern="/^[\-\+]?(0?\d{1,2}\.\d{1,5}|1[0-7]?\d{1}\.\d{1,5}|180\.0{1,5})$/"
						required />
					<div
						ng-show="addStoreForm.maxLongitude.$invalid && addStoreForm.maxLongitude.$dirty">
						<span class="errorText">请输入正确的经度（-180.0~+180.0）整数部分为0~180，必须输入1到5位小数</span>
					</div>
				</div>
			</div>
			<div class="form-group"
				ng-class="{'has-error':addStoreForm.minLongitude.$invalid && addStoreForm.minLongitude.$dirty}">
				<label for="minLongitude" class="control-label col-sm-4">最小经度：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="minLongitude"
						placeholder="请输入最小经度" name="minLongitude" ng-model="minLongitude"
						ng-pattern="/^[\-\+]?(0?\d{1,2}\.\d{1,5}|1[0-7]?\d{1}\.\d{1,5}|180\.0{1,5})$/"
						required />
					<div
						ng-show="addStoreForm.minLongitude.$invalid && addStoreForm.minLongitude.$dirty">
						<span class="errorText">请输入正确的经度（-180.0~+180.0）整数部分为0~180，必须输入1到5位小数</span>
					</div>
				</div>
			</div>
			<div class="form-group" ng-init="getProvince()">
				<label for="province" class="control-label col-sm-4">省份：</label>
				<div class="col-sm-8">
					<select class="form-control" id="province"
						ng-model="selectedProvince" ng-change="updateProvince()"
						ng-options="item.city for item in aProvince" required></select>
				</div>
			</div>
			<div class="form-group">
				<label for="city" class="control-label col-sm-4">城市：</label>
				<div class="col-sm-8">
					<select ng-init="getCitys()" class="form-control" id="city"
						ng-model="selectedCity" ng-change="updateCity()"
						ng-options="item.city for item in aCitys" required>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label for="area" class="control-label col-sm-4">区域：</label>
				<div class="col-sm-8">
					<select ng-init="getCounty(35)" class="form-control" id="area"
						ng-model="selectedCounty"
						ng-options="item.city for item in aCounty" required>
					</select>
				</div>
			</div>
		</div>
		<div class="col-sm-2 col-sm-offset-5">
			<button type="button" class="btn btn-primary submitNewStoreBtn"
				ng-click="submitNewStore()"
				ng-disabled="addStoreForm.storeNo.$invalid ||
                addStoreForm.storeName.$invalid ||
                 addStoreForm.storeAddress.$invalid ||
                 addStoreForm.storeIntroduce.$invalid ||
                 addStoreForm.startTime.$invalid ||
                 addStoreForm.closeTime.$invalid ||
                 addStoreForm.maxLatitude.$invalid ||
                 addStoreForm.minLatitude.$invalid ||
                 addStoreForm.maxLongitude.$invalid ||
                 addStoreForm.minLongitude.$invalid ||
                 startTime == undefined  ||
                 closeTime == undefined  ||
                 (startTime>closeTime) ||
                 aCounty.length==0">保存
			</button>
		</div>
	</form>
</div>